#include<bits/stdc++.h>
using namespace std;
//node define 
typedef struct node{
    int data;
    struct node* next;
    struct node* prior;
}node,*clist;

//forward create!
clist forward_create(clist &L){
    int x;
    cin>>x;
    
    L=new node;
    L->next=L;
    L->prior=L;
    node *r,*s;
    r=L;
    
    while(x!=111){
        s=new node;
        s->data=x;
        r->next=s;
        s->prior=r;
        r=s;
        cin>>x;
    }
    r->prior=s->prior;
    r->next=L;
    return L;
}
void print_clist(clist L){
    node* p=(node*)malloc(sizeof(node));
    p=L->next;
    int i=1;
    while(p!=L){
        cout<<"node "<<i<<" is "<<p->data<<endl;
        cout<<"node "<<i<<" 's address"<<" is "<<p<<endl;
        p=p->next;
        i++;
    }
}
int main(){
    clist L=new node;
    forward_create(L);
    print_clist(L);
 

return 0;
}